package book.dao.Impl;

import org.apache.ibatis.session.SqlSession;

import book.dao.BookDao;
import book.dao.SqlSessionFactoryUtil;
import book.entity.Book;

public class BookDaoImpl implements BookDao {

	public boolean BookAdd(Book book) {
		SqlSession sqlSession=null;
		Boolean b=null;
		try {
			sqlSession=SqlSessionFactoryUtil.getSqlSession();
			BookDao bookDao=sqlSession.getMapper(BookDao.class);
			b=bookDao.BookAdd(book);
			sqlSession.commit();
		} catch (Exception e) {
			e.printStackTrace();
		}finally {
			if(sqlSession!=null){
				sqlSession.close();
			}
		}
		return b;
	}

}
